package com.csdj.t309springboot;

import java.util.concurrent.Callable;

public class Cal implements Callable<Long> {

    private long start;
    private long end;

    public Cal(long start, long end) {
        this.start = start;
        this.end = end;
    }

    @Override
    public Long call() throws Exception {
        long sum = 0L;
        for(long i=start;i<=end;i++){
            sum += i;
        }
        return sum;
    }
}
